package com.sc.nft.dao;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.sc.nft.entity.vo.mall.MallOrderDetailsExchangeVO;
import lombok.extern.slf4j.Slf4j;
import com.sc.nft.entity.MallOrderExchange;
import com.sc.nft.mapper.MallOrderExchangeMapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * 订单关联兑换表(sc_mall_order_exchange)数据DAO
 *
 * @author Sun
 * @since 2023-05-12 10:49:49
 * @description 由 Mybatisplus Code Generator 创建
 */
@Slf4j
@Repository
public class MallOrderExchangeDao extends ServiceImpl<MallOrderExchangeMapper, MallOrderExchange> {

    public List<MallOrderExchange> getOrderExchangeListByOrderId(Long orderId) {
        LambdaQueryWrapper<MallOrderExchange> wrapper = new LambdaQueryWrapper<>();
        wrapper.eq(MallOrderExchange::getOrderId,orderId);
        return list(wrapper);
    }

    public List<MallOrderDetailsExchangeVO> getExchangeListVOByOrderId(Long orderId) {
        return baseMapper.getExchangeListVOByOrderId(orderId);
    }

    public List<MallOrderDetailsExchangeVO> getExchangeListVOByOrderPorductId(Long orderProductId) {
        return baseMapper.getExchangeListVOByOrderPorductId(orderProductId);
    }
}